package main

import "fmt"

func main(){
    c := make(chan int)

    go func() {
        defer fmt.Println("goroutine结束")

        fmt.Println("goroutine 正在运行")
        //发送到channel
        c <- 666
    }()

    //接收数据，<-c 不能有空格
    num := <-c
    fmt.Println("num = ",num)
    fmt.Println("main goroutine 接收...")
}